<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./OL_SDK/include-openlayers-local.js"></script>
    <script src="./libs/gaode.js"></script>
</head>

<body>
    <button onclick="controlArea()">控制区图层的显示/隐藏</button>
    <div id="map">
    </div>
    <script>
        var docLayer = new Zondy.Map.Doc("", "myTestMap", {

        })
        var layer = new ol.layer.Vector({

        })
        var map = new ol.Map({
            target: "map",
            layers: [gaode, docLayer],
            view: new ol.View({
                projection: 'EPSG:4326',
                center: [114.30, 30.50],
                zoom: 4
            })
        })
        console.log(gaode, layer, docLayer, 'gaode, layer, docLayer')
        console.log('Tile图层,Vector图层,doc地图文档图层')

        /* setLayerStatus (只有mapgis封装加载的地图文档的图层上才有这个方法)*/
        console.log(gaode.setLayerStatus, layer.setLayerStatus, docLayer.setLayerStatus)
        // undefined undefined fn 
        // exclude 隐藏  include显示
        let isToggle = false;
        function controlArea() {
            isToggle = !isToggle;
            if (isToggle) {
                docLayer.setLayerStatus([0], "exclude")

            } else {
                docLayer.setLayerStatus([0], "include")
            }
            /* // 这样整个图层（地图文档）里边所有的图层会一起显示隐藏。
            if (isToggle) {
                docLayer.setVisible(false)

            } else {
                docLayer.setVisible(true)
            } */
        }
    </script>
</body>

</html>